package org.prem.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class Main8 {

	public static void main(String args[]){
		Student8 student8 = new Student8();
		student8.setStudent_name("prem8");
		
		StudentDetail8  studentDetail8= new StudentDetail8();
		studentDetail8.setStudent_mobile_number("9994086834");
		studentDetail8.setStudent8(student8);
		
		SessionFactory sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
		Session session = sessionFactory.openSession();
		session.beginTransaction();
		session.save(studentDetail8);
		
		session.getTransaction().commit();
		session.close();
		sessionFactory.close();
	}

}
